#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    this->btn = new QPushButton("代码编写的按钮，点击之后退出界面", this);

    btn->setGeometry(300,200,50,50);

    connect(btn, SIGNAL(clicked(), this, SLOT(close()));
}

MainWindow::~MainWindow()
{
    delete ui;
    delete btn;
}
